function yearchage(year,month,day)
{
     var lastday=0;

     switch(month.value)
     {
        case '1':
        case '3':
        case '5':
        case '7':
        case '8':
        case '10':
        case '12': lastday=31;break;
        case '4':case '6':case '9':case '11': lastday=30;break;
        case '2': if(isleap(year.value))
                   lastday=29;
                else
                   lastday=28
     }
     while(day.options.length!=0)
        day.options[0]=null;
     for(var i=1;i<=lastday;i++)
       {
	       var objOpt =new Option();
	       objOpt.value=i;
	       objOpt.text=i;
               day.options[i-1]=objOpt
       }
}

function isleap(year)
{
      if((year%4==0&&year%100!=0)||year%400==0)
            return true;
      return false;
}

function syn(check,year,month,day,hour,minute)
{
     if(check.checked)
     {
         year.disabled=false;
         month.disabled=false;
         day.disabled=false;
         hour.disabled=false;
         minute.disabled=false;
     }
     else
     {
         year.disabled=true;
         month.disabled=true;
         day.disabled=true;
         hour.disabled=true;
         minute.disabled=true;
     }
}

function synn(check,bigname)
{
     if(check.checked)
     {
         bigname.disabled=false;
		 var str = bigname.value.toString();
	document.getElementById('remain').value-=str.length;
	document.getElementById('input').value=Number(document.getElementById('input').value)+str.length;
    document.getElementById('tiaoshu').value = Math.ceil(document.getElementById('input').value/65);
	if(document.getElementById('input').value>200) document.getElementById('input').value=200;
	if(document.getElementById('remain').value<0) document.getElementById('remain').value=0;

     }
     else
     {
         bigname.disabled=true;
	var str = bigname.value.toString();
	document.getElementById('remain').value=Number(document.getElementById('remain').value)+str.length;
	document.getElementById('input').value-=str.length;
    document.getElementById('tiaoshu').value = Math.ceil(document.getElementById('input').value/65);
	if(document.getElementById('input').value>200) document.getElementById('input').value=200;
	if(document.getElementById('remain').value<0) document.getElementById('remain').value=0;

     }

}